
#ifndef SERVER_INTERFACE_H__
#define SERVER_INTERFACE_H__

#include <iostream>

#include <QDialog>
#include <QtGui>
#include <QtNetwork>

#include "../base/server-client-thread.h"
#include "../base/log.h"
#include "../base/message-server-client.h"
#include "../server/clients-list.h"

class QDialogButtonBox;
class QLabel;
class QPushButton;
class QTimer;
class QUdpSocket;
/*
 * nume: server-interface.h
 * autor: ~D
 * descriere: interfata serverului - pentru test
 * tabela de modificarei
 *   20 iun 2007 - ~D - prima versiune
 *   21 iun 2007 - ~D - adaugat comunicarea - primire si trimitere de datagrame
 */
class ServerInterface : public QDialog
{
    Q_OBJECT

    public:
        ServerInterface(QWidget *parent = 0);
        void process_login_message(const Message* message, quint32 address);

    private slots:
        void send_message();
        void enable_bind_button();
        void create_recv_socket();
        void enable_send_button();
        void process_pending_messages();
        void send_query_result();

    private:
        QLabel *portLabel;
        QLineEdit *portLineEdit;
        QLabel *sendAddressLabel;
        QLineEdit *sendAddressLineEdit;
        QLabel *portSendLabel;
        QLineEdit *portSendLineEdit;
        QLabel *statusLabel;
        QPushButton *startButton;
        QPushButton *quitButton;
        QPushButton *bindButton;
        QDialogButtonBox *buttonBox;
        QTimer* timer;
        ServerClientThread server_to_client_thread_;           // comunicarea dintre server si client
        Message* message_;                  // un mesaj de test...
        ClientsList clients_list_;
};
#endif
